#include <cstdint>
#include <cstring>

#define MAC_ADDRESS_LENGTH 6

typedef uint8_t MAC_address[MAC_ADDRESS_LENGTH];

struct EthernetFrame {
    MAC_address destination;
    MAC_address source;
    uint16_t type;
    uint8_t payload[1500];
};

MAC_address this_mac_address = { 0x00, 0x1A, 0x2B, 0x3C, 0x4D, 0x5E };

int mac_address_match(const EthernetFrame* frame) {
    
    if (std::memcmp(frame->destination, this_mac_address, MAC_ADDRESS_LENGTH) == 0) {
        return 1;
    }

   
    if (frame->destination[0] & 0x01) {
        return 1;
    }

   
    bool is_broadcast = true;
    for (int i = 0; i < MAC_ADDRESS_LENGTH; ++i) {
        if (frame->destination[i] != 0xFF) {
            is_broadcast = false;
            break;
        }
    }
    if (is_broadcast) {
        return 1;
    }

    return 0;
}
